package com.wzdigit.wms.basic.client.request.basic;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 创建承运人输入
 * @author yangdongjie
 * @CreateZoneGroupRequest.java
 * @2021年1月4日上午11:18:30
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"}, ignoreUnknown = false)
public class CreateCarrierRequest implements Serializable {
	
	private static final long serialVersionUID = -4627364690018308857L;

	/**
	 * 承运人编码
	 */
    @ApiModelProperty(value = "承运人编码", required = true)
    @NotBlank(message = "承运人编码不能为空！")
    private String carrierCode;

	/**
	 * 承运人名称
	 */
    @ApiModelProperty(value = "承运人名称", required = true)
    @NotBlank(message = "承运人名称不能为空！")
    private String carrierName;

	/**
	 * 承运人地址
	 */
    @ApiModelProperty(value = "承运人地址", required = false)
    private String carrierAddress;

	/**
	 * 承运人联系人
	 */
    @ApiModelProperty(value = "承运人联系人", required = false)
    private String carrierContact;

	/**
	 * 承运人电话
	 */
    @ApiModelProperty(value = "承运人电话", required = false)
    @Pattern(regexp = "1[3,4,5,8]{1}\\d{9}", message = "手机号码格式有误")
    private String carrierTel;

	/**
	 * 承运人邮箱
	 */
    @ApiModelProperty(value = "承运人邮箱", required = false)
    @Pattern(regexp = "\\w+@(\\w+\\.){1,3}\\w+", message = "邮箱格式有误")
    private String carrierEmail;

	/**
	 * 承运人传真
	 */
    @ApiModelProperty(value = "承运人传真", required = false)
    @Pattern(regexp = "[+]{0,1}(\\d){1,3}[ ]?([-]?((\\d)|[ ]){1,12})+", message = "传真格式有误")
    private String carrierFax;

	/**
	 * 状态
	 */
    @ApiModelProperty(value = "状态", required = true)
    @NotNull(message = "状态不能为空！")
    @Range(min = 0, max = 1, message = "状态错误")
    private Integer status;

	/**
	 * 备注
	 */
    @ApiModelProperty(value = "备注", required = false)
    private String comments;
}